Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suggestion for impl_candidates with E0283 #81042

Merged
merged 2 commits into from
Jan 19, 2021

Conversation

sasurau4
Copy link
Contributor

Fix #42226

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 15, 2021
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_incremental v0.0.0 (/checkout/compiler/rustc_incremental)
    Checking rustc_metadata v0.0.0 (/checkout/compiler/rustc_metadata)
    Checking rustc_symbol_mangling v0.0.0 (/checkout/compiler/rustc_symbol_mangling)
    Checking rustc_save_analysis v0.0.0 (/checkout/compiler/rustc_save_analysis)
error[E0425]: cannot find value `impl_candidate` in this scope
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:677:68
    |
677 | ...                   (e.span, format!("{}::{}({})", impl_candidate, segment.ident, path_segment.ident))
    |                                                      ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `impl_candidates`

error[E0425]: cannot find value `candidates_len` in this scope
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:682:52
    |
682 | ...                   pluralize!(candidates_len),
    |                                  ^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `candidate_len`
    Checking rustc_codegen_ssa v0.0.0 (/checkout/compiler/rustc_codegen_ssa)
error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:679:37
    |
    |
679 |   ...                   err.span_suggestions(
    |                             ^^^^^^^^^^^^^^^^ expected 4 arguments
680 | / ...                       &format!(
681 | | ...                           "use the fully qualified path for the potential candidate{}",
682 | | ...                           pluralize!(candidates_len),
683 | | ...                       ),
    | |___________________________-
684 |   ...                       suggestions,
    |                             -----------
685 |   ...                       Applicability::MaybeIncorrect,

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0061, E0425.
Some errors have detailed explanations: E0061, E0425.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `rustc_infer`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "16" "--release" "--color" "always" "--features" " llvm max_level_info" "--manifest-path" "/checkout/compiler/rustc/Cargo.toml" "-p" "rustc-main" "-p" "rustc_driver" "-p" "rustc_middle" "-p" "rustc_attr" "-p" "rustc_lexer" "-p" "rustc_apfloat" "-p" "rustc_type_ir" "-p" "rustc_index" "-p" "rustc_query_system" "-p" "rustc_macros" "-p" "rustc_arena" "-p" "rustc_feature" "-p" "rustc_parse" "-p" "rustc_hir_pretty" "-p" "rustc_plugin_impl" "-p" "rustc_mir" "-p" "rustc_trait_selection" "-p" "rustc_parse_format" "-p" "coverage_test_macros" "-p" "rustc_graphviz" "-p" "rustc_infer" "-p" "rustc_interface" "-p" "rustc_resolve" "-p" "rustc_passes" "-p" "rustc_ast_passes" "-p" "rustc_privacy" "-p" "rustc_typeck" "-p" "rustc_mir_build" "-p" "rustc_codegen_llvm" "-p" "rustc_fs_util" "-p" "rustc_llvm" "-p" "rustc_symbol_mangling" "-p" "rustc_incremental" "-p" "rustc_expand" "-p" "rustc_builtin_macros" "-p" "rustc_ast_lowering" "-p" "rustc_ty_utils" "-p" "rustc_traits" "-p" "rustc_metadata" "-p" "rustc_ast" "-p" "rustc_ast_pretty" "-p" "rustc_error_codes" "-p" "rustc_data_structures" "-p" "rustc_session" "-p" "rustc_lint_defs" "-p" "rustc_errors" "-p" "rustc_target" "-p" "rustc_span" "-p" "rustc_serialize" "-p" "rustc_save_analysis" "-p" "rustc_hir" "-p" "rustc_lint" "-p" "rustc_codegen_ssa" "--message-format" "json-render-diagnostics"
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
Build completed unsuccessfully in 0:02:48

@estebank
Copy link
Contributor

I think we might introducing an ICE in this PR for some cases (I suspect it might be this line):

---- [ui] ui/issues/issue-23041.rs stdout ----

error: Error: expected failure status (Some(1)) but received status Some(101).
status: exit code: 101
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-23041.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-23041" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-23041/auxiliary"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
thread 'rustc' panicked at 'assertion failed: !self.substitutions.is_empty()', compiler/rustc_errors/src/lib.rs:151:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.51.0-nightly (2f1fe452c 2021-01-17) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
end of query stack

------------------------------------------



failures:
    [ui] ui/issues/issue-23041.rs

test result: FAILED. 11170 passed; 1 failed; 87 ignored; 0 measured; 0 filtered out; finished in 133.45s

@estebank estebank added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 17, 2021
sasurau4 and others added 2 commits January 18, 2021 21:57
Update compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
@sasurau4
Copy link
Contributor Author

@rustbot modify labels to +S-waiting-on-review, -S-waiting-on-author

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 18, 2021
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 18, 2021

📌 Commit 8b041cd has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 18, 2021
@bors
Copy link
Contributor

bors commented Jan 19, 2021

⌛ Testing commit 8b041cd with merge 4ba1aaf...

@bors
Copy link
Contributor

bors commented Jan 19, 2021

☀️ Test successful - checks-actions
Approved by: estebank
Pushing 4ba1aaf to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 19, 2021
@bors bors merged commit 4ba1aaf into rust-lang:master Jan 19, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 19, 2021
@sasurau4 sasurau4 deleted the fix/unclear-error-with-trait branch January 19, 2021 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unclear errors with type annotations on functions instead of their traits
6 participants